﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="MostViewed.aspx.vb" Inherits="WeightLossProject.MmostViewed" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2 class="custom-header">TOP 10 Most Viewed Weight Loss Progress Updates</h2>
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" DataKeyNames="ID" DataSourceID="SqlDataSource2" 
        ForeColor="Black" GridLines="Horizontal">

        <Columns>
                <asp:TemplateField HeaderText="Progress Picture">
                <ItemTemplate>
                    <a href = "ProgressPage.aspx?PID=<%# Eval("ID") %>"><img src="<%# Eval("Picture") %>"  width="100px" /></a>
                </ItemTemplate>
                    <ControlStyle CssClass="progressPic" Height="100px" Width="100px" />
                </asp:TemplateField>
                <asp:BoundField DataField="Title" HeaderText="Title" 
                    SortExpression="Title" >
                <ControlStyle Width="200px" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Description">
                    <ItemTemplate>
                    <a href = "ProgressPage.aspx?PID=<%# Eval("ID") %>">
                        <%# Eval("Description").ToString().Substring(0, 70) + " ...."%> 
                    </a>
                   </ItemTemplate>

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Member">
                    <ItemTemplate>
                    <a href = "ProfilePage.aspx?UID=<%# Eval("UserID") %>">
                        <%# Eval("UserName")%> 
                    </a>
                   </ItemTemplate>
                </asp:TemplateField>


                <asp:BoundField DataField="Weight" HeaderText="Weight" 
                    SortExpression="Weight" />
                <asp:BoundField DataField="EntryDate" HeaderText="Date" 
                    SortExpression="EntryDate" >
                <ControlStyle Font-Size="Small" />

                </asp:BoundField>
                <asp:BoundField DataField="ViewsCount" HeaderText="Views" />
            </Columns>


        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#242121" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT * FROM [MostViewed]"></asp:SqlDataSource>
    <br />
    </asp:Content>
